﻿using System;
using System.Windows;

namespace JustinAngel.Neurons.Framework.Helpers
{
    public static class DispatcherHelper
    {
        public static void BeginInvokeOnUIThread(Action action)
        {
            var Dispatcher = Deployment.Current.Dispatcher;
            if (Dispatcher.CheckAccess() == false)
            {
                Deployment.Current.Dispatcher.BeginInvoke(action);
            }
            else
            {
                action();
            }
        }
    }
}
